﻿namespace EyeOpen
{
	using System;
	using System.ComponentModel;

	public class AsyncWorker
	{
		public void RunWorkerAsync<T>(T parameter, Action<T> action)
		{
			var backgroundWorker =
				new BackgroundWorker();

			backgroundWorker.DoWork +=
				(s, w) => action(parameter);

			backgroundWorker.RunWorkerAsync(parameter);
		}
	}
}